import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { AuthGuardService } from '../service/auth.guard.service';

import { MainComponent } from '../component/main/main.component';

const routers: Routes = [
    {
        path: 'main',
        component: MainComponent,
        canActivate: [AuthGuardService],    // 路由守护
        loadChildren: '../module/main.child.module#MainChildModule'
    },
];

@NgModule({
    imports: [
        RouterModule.forChild(routers)
    ],
    exports: [
        RouterModule
    ],
    providers: [
    ]
})
export class MainRouter { }

